#include <REGX52.H>
#include "74HC595.h"

// 要显示的动画数据
unsigned char arr[] 
	= {	0x3C,0x42,0xA9,0x85,0x85,0xA9,0x42,0x3C,
			0x3C,0x42,0xA1,0x85,0x85,0xA1,0x42,0x3C,
			0x3C,0x42,0xA5,0x89,0x89,0xA5,0x42,0x3C};

void main()
{
	unsigned char i = 0, offset = 0, count = 0;
	
	_74HC595_init();
	
	while(1)
	{
		for(i = 0; i < 8; i++)
		{
			MATRIX_LED_showColumn(i, arr[i + offset]);
		}
		count++; // 延时计次
		if(count > 15)
		{
			count = 0;
			offset += 8; // 偏移量+8，切换下一帧画面
			if(offset > 16)
			{
				offset = 0;
			}
		}
	}
}